
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/bootstrap/css/bootstrap.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/font-awesome/css/font-awesome.min.css">
    <!-- Custom Font Icons CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/font.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/custom.css">
    <title>文章</title>

</head>
<body>
<%@include file="public_jsp/header.jsp" %>

<div class="d-flex align-items-stretch">
    <!-- Sidebar Navigation-->
    <%@include file="public_jsp/sidebar.jsp" %>
    <!-- Sidebar Navigation end-->
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">我收藏的文章</h2>
            </div>
        </div>

        <section class="no-padding-bottom">

            <div class="list-group myList">
                <!--搜索文章的条件-->
                <div class="myTitle">
                    <form class="form-inline" action="${pageContext.request.contextPath}/article/myCollection"
                          method="post">

                        <div class="form-group">
                            <label for="inlineFormInput" class="sr-only">Name</label>
                            <c:if test="${requestScope.articleName==null}">
                                <input id="inlineFormInput" type="text" placeholder="按标题名字查找"
                                       class="mr-sm-3 form-control" name="articleName">
                            </c:if>
                            <c:if test="${requestScope.articleName!=null}">
                                <input id="inlineFormInput" type="text" placeholder="按标题名字查找"
                                class="mr-sm-3 form-control" name="articleName"
                                value="${requestScope.articleName}">
                            </c:if>
                        </div>
                        <div class="form-group">
                            <input type="submit" value="查询" class="btn btn-primary">
                        </div>
                    </form>


                </div>

                <ul>
                    <c:forEach items="${requestScope.articleList}" var="article">

                        <li class="list-group-item">
                            <div style="float: right;">
                                <span><strong>收藏数：</strong>${article.count}</span>
                                <span>&nbsp;</span>
                                <span>&nbsp;</span>
                                <span>&nbsp;</span>
                                <span><strong>浏览数：</strong>${article.browse_count}</span>
                            </div>
                            <a href="${pageContext.request.contextPath}/view/articleDetail?bookId=${article.id}">${article.title}</a>
                            <p class="h6"><strong>作者：</strong>${article.publish_username}</p>
                            <p class="h6"><strong>时间：</strong>${article.publish_date}</p>
                            <p style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis">${article.content}</p>
                        </li>
                    </c:forEach>

                </ul>

                <nav class="text-center" aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <c:forEach end="${requestScope.articleTotalCount}" begin="1" varStatus="i" step="1">
                            <c:if test="${requestScope.articleName !=null}">
                                <li>
                                    <a href="${pageContext.request.contextPath}/view/articleCollect?articleName=${requestScope.articleName}&current=${i.count}&">${i.count}</a>
                                </li>
                            </c:if>
                            <c:if test="${requestScope.articleName ==null}">
                                <li>
                                    <a href="${pageContext.request.contextPath}/view/articleCollect?current=${i.count}">${i.count}</a>
                                </li>
                            </c:if>
                        </c:forEach>

                        <li>
                            <a href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </section>

        <%@include file="public_jsp/foot.jsp" %>
    </div>
</div>

<!-- JavaScript files-->
<script src="${pageContext.request.contextPath}/assets/vendor/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/popper.js/umd/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery.cookie/jquery.cookie.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/chart.js/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery-validation/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/charts-home.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/front.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/custom.js"></script>

<%--<script>--%>
    <%--$(function () {--%>

        <%--var contextPath = $("#contextPath").val();--%>
        <%--var userId = $("#userId").val();--%>

        <%--//添加文章跳转链接--%>
        <%--$("#addArt").click(function () {--%>
            <%--window.location.href = contextPath+'/article/publishArticle'--%>
        <%--});--%>

    <%--})--%>
<%--</script>--%>
</body>
</html>